
	$(function(){
	   easyloader.base = 'js/tools/easyui/';
	   using("locale/easyui-lang-zh_CN.js",function(){
	      var columns=[[
	                              {field: 'name',title: '姓名',width: 80,align: 'left'},
						          {field: 'sex',title: '性别',width:50,align: 'center'},
								  {field: 'amount',title: '金额',width: 80,align: 'left'},
						          {field: 'cardType',title: '卡的类型',width: 90,align: 'left'}, 
								  {field: 'idcard',title: '身份证号',width: 150,align: 'left'}, 
								  {field: 'tel',title: '电话',width: 90,align: 'left'}, 
								  {field: 'remark',title: '备注',width: 150,align: 'left'},
								  {field: 'datetime',title: '时间',width:120,align: 'left'},
								  {field: 'returnVisit',title: '回访',width: 90,align: 'left'},
								   {field: 'opt',title: '操作',width: 70,align: 'center'}
							 ]];
	         createDateGrid(columns,'buycard!buycardListForJson.action?time='+new Date().getTime(),'',true,580);
			
	   });
	   
	  
	});
	//回访
function returnVisit(id,returnVisit)
{
	$.getJSON("buycard!returnVisit.action",{"buycard.id":id,"buycard.returnVisit":returnVisit},function(data){
		$("#dataGrid").datagrid("reload");
	});
}
//删除
function  deleteBuycard(id)
{
	$.getJSON("buycard!delteBuycard.action",{"buycard.id":id},function(data){
		if(data.info)
		{
			$("#dataGrid").datagrid("reload");
			alert("删除成功!");
		}else
		{
			alert("删除失败!");
		}
	});
}
